Skip to content

Conversation

amosonn
Copy link
Contributor

@amosonn amosonn commented Feb 3, 2020

r? @nagisa
See #68616 for main discussion.

- Stopping condition inside mod_inv can be >= instead of >
- Remove intrinsics::unchecked_rem, we are working modulu powers-of-2 so
we can simply mask
- When calculating the inverse, it's enough to work `mod a/g` instead
  of `mod a`.
- As explained in the comment inside mod_inv, it is valid to work mod
  `usize::max_value()` right until the end.
@amosonn amosonn requested a review from nagisa February 3, 2020 00:14
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 3, 2020
@amosonn amosonn changed the title Patch 1 Optimize core::ptr::align_offset (part 1) Feb 3, 2020
@nagisa
Copy link
Member

nagisa commented Feb 3, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 3, 2020

📌 Commit 22b263a has been approved by nagisa

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 3, 2020
Optimize core::ptr::align_offset (part 1)

r? @nagisa
See rust-lang#68616 for main discussion.
bors added a commit that referenced this pull request Feb 3, 2020
Rollup of 8 pull requests

Successful merges:

 - #68678 (Install robots.txt into rust-docs tarballs)
 - #68711 (Added upper bound of what vecs and boxes can allocate)
 - #68744 (Do not ICE in `type-alias-impl-trait` with save-analysis)
 - #68777 (Clean up E0263 explanation)
 - #68787 (Optimize core::ptr::align_offset (part 1))
 - #68797 (Fix links to types instead of modules)
 - #68798 (Test that `#[track_caller]` as `fn()` respects RT / CTFE equivalence)
 - #68800 (Stabilize `core::iter::once_with()`)

Failed merges:

r? @ghost
@bors bors merged commit 22b263a into rust-lang:master Feb 3, 2020
@amosonn amosonn deleted the patch-1 branch February 7, 2020 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants